﻿namespace Vampirewal.BlogCore.TestWebApi;

/// <summary>
/// 1、项目说明页面
/// </summary>
public class ProjectInfoPage : PageBase
{
    private TestOptions _testOptions { get; set; }

    public ProjectInfoPage(UserManager user, IBlogOption<BlogOptions> option,IBlogOption<TestOptions> testop)
    {
        _testOptions = testop.GetValue();
    }

    public override bool IsCache => true;

    public override string Title => "项目说明";
    public override string MenuGroup => "说明";

    public override int MenuGroupSort => 0;
    public override int Sort => 0;

    public override List<Tag> Tags => new List<Tag>()
    {
        App.CreateTag("重要", TagType.Primary),
    };

    public override List<PartContainer> PartContainers => new List<PartContainer>()
    {
        App.CreatePartContainer("使用前必读", child =>
        {
            App.CreateTip("提示", TipType.Success, content =>
            {
                App.CreateSpace(space =>
                {
                    App.CreateText($"当前Vampirewal.BlogCore版本为{_testOptions.NugetVersion}").AddToChildren(space);
                    App.CreateText(textContent =>
                    {
                        App.CreateText("通过包管理器安装:").AddToChildren(textContent);
                        App.CreateText($"NuGet\\Install-Package Vampirewal.BlogCore -Version {_testOptions.NugetVersion}",tag: TextTagType.Ins).AddToChildren(textContent);
                    }).AddToChildren(space);
                },direction: DirectionType.Vertical).AddToChildren(content);
            }).AddToChildren(child);
        }),

        App.CreatePartContainer("个人使用须知", child =>
        {
            App.CreateSpace(space =>
            {
                App.CreateText("1) 不得将程序集用作违法犯罪活动。").AddToChildren(space);
                App.CreateText("2) 不得将程序集单独包装售卖，申请专利等。").AddToChildren(space);
                App.CreateText("3) 不得擦除程序集所有有关作者的信息。").AddToChildren(space);
            },direction: DirectionType.Vertical).AddToChildren(child);

            App.CreateTip("警告", TipType.Warning, content =>
            {
                App.CreateText("以上内容必须全部符合，个人使用授权才成立。").AddToChildren(content);
            }).AddToChildren(child);
        }),

        App.CreatePartContainer("开发计划", child =>
        {
            //App.CreateSpace(space =>
            //{
            //    App.CreateText(content =>
            //    {
            //        App.CreateIcon("<Select />", "#009400").AddToChildren(content);
            //        App.CreateText("使用Element-plus").AddToChildren(content);
            //    }).AddToChildren(space);

            //},direction: DirectionType.Vertical).AddToChildren(child);

            App.CreateDescriptions("", it =>
            {
                App.CreateDescriptionItem("计划","完成情况", AlignType.Center).AddToChildren(it);
                App.CreateDescriptionItem("使用Element-plus",()=>App.CreateIcon("<Select />", "#009400")).AddToChildren(it);
                //App.CreateDescriptionItem("更多配置项",()=>App.CreateIcon("<CloseBold />", "#f56c6c")).AddToChildren(it);
                App.CreateDescriptionItem("表单",()=>App.CreateIcon("<Select />", "#009400")).AddToChildren(it);
                App.CreateDescriptionItem("更多配置项",()=>App.CreateIcon("<Select />", "#009400")).AddToChildren(it);
            },direction: DirectionType.Horizontal).AddToChildren(child);
        }),
    };
}